home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / Mac OS USB DDK_v1.0.1 / Interfaces / SIOW.r < prev    next >
Encoding:
Text File  |  1998-09-03  |  8.9 KB  |  455 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        SIOW.r
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Version:    xxx put version here xxx
  7.  
  8.     Copyright:    © 1998 by Apple Computer, Inc., all rights reserved.
  9.  
  10. */
  11.  
  12. /*------------------------------------------------------------------------------
  13. #
  14. #    Apple Macintosh Developer Technical Support
  15. #
  16. #    MultiFinder-Aware Simple Input/Output Window
  17. #
  18. #    SIOW
  19. #
  20. #    Copyright:    © 1989-1993, 1998 by Apple Computer, Inc., all rights reserved.
  21. #
  22. ------------------------------------------------------------------------------*/
  23.  
  24. //#include "systypes.r"
  25. #define SystemSevenOrLater 1
  26. #include "types.r"
  27.  
  28. #include "SIOW.h"
  29.  
  30. #ifndef CREATOR
  31.     #define CREATOR 'siow'
  32. #endif
  33.  
  34. #ifndef FCREATOR
  35.     #define FCREATOR 'MPS '
  36. #endif
  37.  
  38. #ifndef WINDOW_HEIGTH
  39.     #define WINDOW_HEIGTH 286
  40. #endif
  41.  
  42. #ifndef WINDOW_WIDTH
  43.     #define WINDOW_WIDTH 480
  44. #endif
  45.  
  46.  
  47. type 'pzza' {
  48.     literal longint;
  49. };
  50.  
  51. resource 'pzza' (128, purgeable) {
  52.     FCREATOR;
  53. };
  54.  
  55. /* we use an MBAR resource to conveniently load all the menus */
  56.  
  57. resource 'MBAR' (__rMenuBar, preload) {
  58.     { __mApple, __mFile, __mEdit, __mFont /*, __mSize */};        /* five menus */
  59. };
  60.  
  61.  
  62. resource 'MENU' (__mApple, preload) {
  63.     __mApple, textMenuProc,
  64.     0b1111111111111111111111111111101,    /* disable dashed line, enable About and DAs */
  65.     enabled, apple,
  66.     {
  67.         "About S I O W\311",
  68.             noicon, nokey, nomark, plain;
  69.         "-",
  70.             noicon, nokey, nomark, plain
  71.     }
  72. };
  73.  
  74. resource 'MENU' (__mFile, preload) {
  75.     __mFile, textMenuProc,
  76.     0b000000000000000000000000000000,    /* enable Quit only, program enables others */
  77.     enabled, "File",
  78.     {
  79.         "New",
  80.             noicon, "N", nomark, plain;
  81.         "Open",
  82.             noicon, "O", nomark, plain;
  83.         "-",
  84.             noicon, nokey, nomark, plain;
  85.         "Close",
  86.             noicon, "W", nomark, plain;
  87.         "Save",
  88.             noicon, "S", nomark, plain;
  89.         "Save As\311",
  90.             noicon, nokey, nomark, plain;
  91.         "-",
  92.             noicon, nokey, nomark, plain;
  93.         "Page Setup\311",
  94.             noicon, nokey, nomark, plain;
  95. // 12/13/93 - Added Command-P equivalent to Print item
  96.         "Print\311",
  97.             noicon, "P", nomark, plain;
  98.         "-",
  99.             noicon, nokey, nomark, plain;
  100.         "Quit",
  101.             noicon, "Q", nomark, plain
  102.     }
  103. };
  104.  
  105. resource 'MENU' (__mEdit, preload) {
  106.     __mEdit, textMenuProc,
  107.     0b0000000000000000000000000000000,    /* disable everything, program does the enabling */
  108.     enabled, "Edit",
  109.      {
  110.         "Undo",
  111.             noicon, "Z", nomark, plain;
  112.         "-",
  113.             noicon, nokey, nomark, plain;
  114.         "Cut",
  115.             noicon, "X", nomark, plain;
  116.         "Copy",
  117.             noicon, "C", nomark, plain;
  118.         "Paste",
  119.             noicon, "V", nomark, plain;
  120.         "Clear",
  121.             noicon, nokey, nomark, plain
  122.     }
  123. };
  124.  
  125. resource 'MENU' (__mFont, preload) {
  126.     __mFont, textMenuProc,
  127.     0b1111111111111111111111111111111,    /* enable everything */
  128.     enabled, "Font",
  129.      {
  130.      }
  131. };
  132.  
  133. /* this ALRT and DITL are used as an About screen */
  134.  
  135. resource 'ALRT' (__rAboutAlert, purgeable) {
  136. // 12/13/93 - GAB: support for native PowerPC version
  137. #ifdef APPNAME    // taller dialog for PowerPC version
  138.     {66, 58, 354, 396},
  139. #else
  140.     {66, 58, 344, 396},
  141. #endif
  142.      __rAboutAlert, {
  143.         OK, visible, silent;
  144.         OK, visible, silent;
  145.         OK, visible, silent;
  146.         OK, visible, silent
  147.     }
  148.     /*    The following are window positioning options ,usable in 7.0    */
  149. #if SystemSevenOrLater
  150.     , centerParentWindowScreen
  151. #endif
  152.     ;
  153. };
  154.  
  155. resource 'DITL' (__rAboutAlert, purgeable) {
  156.     {    /* array DITLarray: 10 elements */
  157.         /* [1] */
  158. // 12/13/93 - GAB: support for native PowerPC version
  159. #ifdef APPNAME    // taller dialog for PowerPC version
  160.         {260, 129, 280, 209},
  161. #else
  162.         {233, 144, 253, 224},
  163. #endif
  164.         Button {
  165.             enabled,
  166.             "OK"
  167.         },
  168.         /* [2] */
  169.         {8, 72, 23, 264},
  170.         StaticText {
  171.             disabled,
  172.             "Simple Input/Output Window"
  173.         },
  174.         /* [3] */
  175.         {56, 24, 71, 337},
  176.         StaticText {
  177.             disabled,
  178.             $$Format("Copyright ©Apple Computer, Inc. 1989-%d ", $$Year)
  179.         },
  180.         /* [4] */
  181.         {80, 108, 96, 244},
  182.         StaticText {
  183.             disabled,
  184.             "Brought to you by..."
  185.         },
  186.         /* [5] */
  187.         {109, 132, 134, 229},
  188.         StaticText {
  189.             disabled,
  190.             "\"PZZA SLT\""
  191.         },
  192.         /* [6] */
  193.         {152, 24, 170, 212},
  194.         StaticText {
  195.             disabled,
  196.             "Special Thanks to..."
  197.         },
  198.         /* [7] */
  199.         {176, 56, 194, 289},
  200.         StaticText {
  201.             disabled,
  202.             "Roger, Russ, Landon, Ira & Munch"
  203.         },
  204. // 12/13/93 - GAB: support for native PowerPC version
  205. #ifdef APPNAME    // for native PowerPC build only
  206.         /* [8] */
  207.         {200, 24, 218, 212},
  208.         StaticText {
  209.             disabled,
  210.             "PowerPC port by…"
  211.         },
  212.         /* [9] */
  213.         {224, 56, 242, 289},
  214.         StaticText {
  215.             disabled,
  216.             "Greg Branche"
  217.         },
  218. #endif
  219.         /* [10] */
  220.         {32, 152, 47, 200},
  221.         StaticText {
  222.             disabled,
  223.             "(SIOW)"
  224.         }
  225.     }
  226. };
  227.  
  228. /* this ALRT and DITL are used as an error screen */
  229.  
  230. resource 'ALRT' (__rUserAlert, purgeable) {
  231.     {40, 20, 150, 260},
  232.     __rUserAlert,
  233.     { /* array: 4 elements */
  234.         /* [1] */
  235.         OK, visible, silent,
  236.         /* [2] */
  237.         OK, visible, silent,
  238.         /* [3] */
  239.         OK, visible, silent,
  240.         /* [4] */
  241.         OK, visible, silent
  242.     }
  243. #if SystemSevenOrLater
  244.     , alertPositionParentWindowScreen
  245. #endif
  246. };
  247.  
  248.  
  249. resource 'DITL' (__rUserAlert, purgeable) {
  250.     { /* array DITLarray: 3 elements */
  251.         /* [1] */
  252.         {80, 150, 100, 230},
  253.         Button {
  254.             enabled,
  255.             "OK"
  256.         },
  257.         /* [2] */
  258.         {10, 60, 60, 230},
  259.         StaticText {
  260.             disabled,
  261.             "Error. ^0."
  262.         },
  263.         /* [3] */
  264.         {8, 8, 40, 40},
  265.         Icon {
  266.             disabled,
  267.             2
  268.         }
  269.     }
  270. };
  271.  
  272.  
  273. resource 'WIND' (__rDocWindow, preload, purgeable) {
  274.     {0, 0, WINDOW_HEIGTH, WINDOW_WIDTH},
  275.     zoomDocProc, invisible, noGoAway, 0x0, "untitled"
  276.     /*    The following are window positioning options ,usable in 7.0    */
  277. #if SystemSevenOrLater
  278.     , noAutoCenter
  279. #endif
  280. };
  281.  
  282. resource 'CNTL' (__rVScroll, preload, purgeable) {
  283.     {-1, WINDOW_WIDTH-15, WINDOW_HEIGTH-14, WINDOW_WIDTH+1},
  284.     0, invisible, 0, 0, scrollBarProc, 0, ""
  285. };
  286.  
  287. resource 'CNTL' (__rHScroll, preload, purgeable) {
  288.     {WINDOW_HEIGTH-15, -1, WINDOW_HEIGTH+1, WINDOW_WIDTH-14},
  289.     0, invisible, 0, 0, scrollBarProc, 0, ""
  290. };
  291.  
  292. resource 'STR#' (__kErrStrings, purgeable) {
  293.     {
  294.     "You must run on 512Ke or later";
  295.     "Application Memory Size is too small";
  296.     "Not enough memory to run SIOW";
  297.     "Not enough memory to do Cut";
  298.     "Cannot do Cut";
  299.     "Cannot do Copy";
  300.     "Cannot exceed 32,000 characters with Paste";
  301.     "Not enough memory to do Paste";
  302.     "Cannot create window";
  303.     "Cannot exceed 32,000 characters";
  304.     "Cannot do Paste";
  305.     "Font not found";
  306.     "Cannot exceed request count during input - text truncated"
  307.     }
  308. };
  309.  
  310. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  311.  
  312. resource 'SIZE' (-1) {
  313.     dontSaveScreen,
  314.     acceptSuspendResumeEvents,
  315.     enableOptionSwitch,
  316.     canBackground,                /* we can background; we don't currently, but our sleep value */
  317.                                 /* guarantees we don't hog the Mac while we are in the background */
  318.     multiFinderAware,            /* this says we do our own activate/deactivate; don't fake us out */
  319.     backgroundAndForeground,    /* this is definitely not a background-only application! */
  320.     dontGetFrontClicks,            /* change this is if you want "do first click" behavior like the Finder */
  321.     ignoreChildDiedEvents,        /* essentially, I'm not a debugger (sub-launching) */
  322.     is32BitCompatible,            /* this app should not be run in 32-bit address space */
  323.     reserved,
  324.     reserved,
  325.     reserved,
  326.     reserved,
  327.     reserved,
  328.     reserved,
  329.     reserved,
  330.     __kPrefSize * 1024,
  331.     __kMinSize * 1024    
  332. };
  333.  
  334.  
  335. type CREATOR as 'STR ';
  336.  
  337.  
  338. resource CREATOR (0) {
  339.     "MultiFinder-Aware Simple Input/Output Window (SIOW)"
  340. };
  341.  
  342.  
  343. resource 'BNDL' (128) {
  344.     CREATOR,
  345.     0,
  346.     {
  347.         'ICN#',
  348.         {
  349.             0, 128
  350.         },
  351.         'FREF',
  352.         {
  353.             0, 128
  354.         }
  355.     }
  356. };
  357.  
  358.  
  359. resource 'FREF' (128) {
  360.     'APPL',
  361.     0,
  362.     ""
  363. };
  364.  
  365.  
  366. resource 'ICN#' (128) {
  367.     {    /* array: 2 elements */
  368.         /* [1] */
  369.         $"0000 0000 0000 0000 0010 4100 0010 2200"
  370.         $"0020 2200 0020 2100 0020 4100 0010 4200"
  371.         $"0010 4200 0010 2200 0020 2100 0020 0100"
  372.         $"00FF FF00 03FF FFE0 0791 03F0 0ED1 0E7C"
  373.         $"1C31 321C 380D C10E 3FFF FFFE 3003 C106"
  374.         $"380D 300E 1E31 0E3C 1FC1 01F8 07FF FFE0"
  375.         $"00FF FE00",
  376.         /* [2] */
  377.         $"0000 0000 0000 0000 0010 4100 0010 2200"
  378.         $"0020 2200 0020 2100 0020 4100 0010 4200"
  379.         $"0010 4200 0010 2200 0020 2100 0020 0100"
  380.         $"00FF FF00 03FF FFE0 07FF FFF0 0FFF FFFC"
  381.         $"1FFF FFFC 3FFF FFFE 3FFF FFFE 3FFF FFFE"
  382.         $"3FFF FFFE 1FFF FFFC 1FFF FFF8 07FF FFE0"
  383.         $"00FF FE00"
  384.     }
  385. };
  386.  
  387. resource 'ALRT' (__rSaveAlert, preload) {
  388.     {72, 64, 212, 372},
  389.     __rSaveAlert,
  390.     {    /* array: 4 elements */
  391.         /* [1] */
  392.         OK, visible, silent,
  393.         /* [2] */
  394.         OK, visible, silent,
  395.         /* [3] */
  396.         OK, visible, silent,
  397.         /* [4] */
  398.         OK, visible, silent
  399.     }
  400.     /*    The following are window positioning options ,usable in 7.0    */
  401. #if SystemSevenOrLater
  402.     , alertPositionParentWindowScreen
  403. #endif
  404.     ;
  405. };
  406.  
  407. resource 'DITL' (__rSaveAlert, preload) {
  408.     {    /* array DITLarray: 4 elements */
  409.         /* [1] */
  410.         {58, 25, 76, 99},
  411.         Button {
  412.             enabled,
  413.             "Yes"
  414.         },
  415.         /* [2] */
  416.         {86, 25, 104, 99},
  417.         Button {
  418.             enabled,
  419.             "No"
  420.         },
  421.         /* [3] */
  422.         {12, 20, 45, 277},
  423.         StaticText {
  424.             disabled,
  425.             "Save changes before closing?"
  426.         },
  427.         /* [4] */
  428.         {86, 195, 104, 269},
  429.         Button {
  430.             enabled,
  431.             "Cancel"
  432.         }
  433.     }
  434. };
  435.  
  436.  
  437. // 12/13/93 - GAB: Support for native PowerPC version
  438.  
  439. #ifdef APPNAME    // only include 'cfrg' in native PowerPC apps
  440.  
  441. #include "CodeFragmentTypes.r"
  442.  
  443. resource 'cfrg' (0) {
  444.     {
  445.         kPowerPC,
  446.         kFullLib,
  447.         kNoVersionNum,kNoVersionNum,
  448.         0,0,
  449.         kIsApp,kOnDiskFlat,kZeroOffset,kWholeFork,
  450.         APPNAME    // must be defined on Rez command line with -d option
  451.     }
  452. };
  453.  
  454. #endif
  455.